<div class="nav-route" class="nav-route">
    <div class="container">
        <div class="data-summary">
            共 <?=$count ?> 条
        </div>
        <div class="nav-pagination">
            <ul>
                <?php if ($page == 1): ?>
                    <li class="disabled"><a href="##" aria-label="Previous"><span aria-hidden="true">上一页</span></a></li>
                <?php else: ?>
                    <li class=""><a href="<?=$url.($page - 1).'?'.$get ?>" aria-label="Previous"><span aria-hidden="true"><!-- &laquo; --> 上一页</span></a></li>
                <?php endif ?>
                
                <?php if (ceil($count / $line) < 5): ?>
                    <?php for ($i = 1; $i <= ceil($count / $line) ; $i++): ?>
                        <li class="<?=$i == $page ? 'active' : '' ?>"><a href="<?=$url.$i.'?'.$get ?>"><?=$i ?> <span class="sr-only"></span></a></li>
                    <?php endfor ?>
                <?php else: ?>
                    <?php if (ceil($count / $line) - $page >= 2): ?>
                        <?php if ($page <= 2): ?>
                            <?php for ($i = 1; $i <= 5; $i++): ?>
                                <li class="<?=$i == $page ? 'active' : '' ?>"><a href="<?=$url.$i.'?'.$get ?>"><?=$i ?> <span class="sr-only"></span></a></li>
                            <?php endfor ?>
                        <?php else: ?>
                            <?php for ($i = $page - 2; $i <= $page + 2; $i++): ?>
                                <li class="<?=$i == $page ? 'active' : '' ?>"><a href="<?=$url.$i.'?'.$get ?>"><?=$i ?> <span class="sr-only"></span></a></li>
                            <?php endfor ?>
                        <?php endif ?>
                    <?php else: ?>
                        <?php for ($i = ceil($count / $line) - 4; $i <= ceil($count / $line); $i++): ?>
                            <li class="<?=$i == $page ? 'active' : '' ?>"><a href="<?=$url.$i.'?'.$get ?>"><?=$i ?> <span class="sr-only"></span></a></li>
                        <?php endfor ?>
                    <?php endif ?>
                <?php endif; ?>

                <?php if ($page == ceil($count / $line) || $count == 0): ?>
                    <li class="disabled"><a href="##" aria-label="Next"><span aria-hidden="true">下一页</span></a></li>  
                <?php else: ?>
                    <li class=""><a href="<?=$url.($page + 1).'?'.$get ?>" aria-label="Next"><span aria-hidden="true">下一页<!--  &raquo; --></span></a></li>  
                <?php endif ?>

            </ul>
            <div class="page-route">
                <span>前往</span>
                <input type="text" id="page-num" data-min="1" data-max="<?=ceil($count / $line) ?>" class="form-control nav-page" data-href="<?=$url.'{{page}}'.'?'.$get ?>" placeholder="">
                <span>页</span>
            </div>                       
        </div>
    </div>
    
</div>